<template>
  <div>
    <!--<a v-for="t in tags" :key="t.id" @click="filterTag(t)">{{t.val}}</a>-->
    <tag v-for="t in tags" :key="t.id" :tag="t" @click="filterTag(t)">{{t.val}}</tag>
    <!--<a href>...更多</a>-->
  </div>
</template>

<script>
import Tag from "./Tag.vue";
import {EVENTS, EVENT_BUS} from "@/eventbus.js";

export default {
  components: {
    Tag
  },
  props: ["tags"],
  data() {
    return {
    };
  },
  methods: {
    filterTag(t) {
      EVENT_BUS.$emit(EVENTS.MATS_FILTER, {
        kind: "tag",
        cat: t.cat,
        value: t
      });
    }
  }
};
</script>